Optimal. Leaf size=42 \[ -\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}-\frac {\tanh ^{-1}(\cos (x))}{a+b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3190, 391, 206, 205} \[ -\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}-\frac {\tanh ^{-1}(\cos (x))}{a+b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 206
Rule 391
Rule 3190
Rubi steps
\begin {align*} \int \frac {\csc (x)}{a+b \cos ^2(x)} \, dx &=-\operatorname {Subst}\left (\int \frac {1}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\cos (x)\right )\\ &=-\frac {\operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (x)\right )}{a+b}-\frac {b \operatorname {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\cos (x)\right )}{a+b}\\ &=-\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}-\frac {\tanh ^{-1}(\cos (x))}{a+b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.05, size = 50, normalized size = 1.19 \[ \frac {-\frac {2 \sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a}}+\log (1-\cos (x))-\log (\cos (x)+1)}{2 (a+b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.75, size = 113, normalized size = 2.69 \[ \left [\frac {\sqrt {-\frac {b}{a}} \log \left (\frac {b \cos \relax (x)^{2} - 2 \, a \sqrt {-\frac {b}{a}} \cos \relax (x) - a}{b \cos \relax (x)^{2} + a}\right ) - \log \left (\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) + \log \left (-\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right )}{2 \, {\left (a + b\right )}}, -\frac {2 \, \sqrt {\frac {b}{a}} \arctan \left (\sqrt {\frac {b}{a}} \cos \relax (x)\right ) + \log \left (\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) - \log \left (-\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right )}{2 \, {\left (a + b\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.22, size = 50, normalized size = 1.19 \[ -\frac {b \arctan \left (\frac {b \cos \relax (x)}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} - \frac {\log \left (\cos \relax (x) + 1\right )}{2 \, {\left (a + b\right )}} + \frac {\log \left (-\cos \relax (x) + 1\right )}{2 \, {\left (a + b\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.10, size = 56, normalized size = 1.33 \[ -\frac {b \arctan \left (\frac {\cos \relax (x ) b}{\sqrt {a b}}\right )}{\left (a +b \right ) \sqrt {a b}}+\frac {\ln \left (-1+\cos \relax (x )\right )}{2 a +2 b}-\frac {\ln \left (\cos \relax (x )+1\right )}{2 a +2 b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.72, size = 48, normalized size = 1.14 \[ -\frac {b \arctan \left (\frac {b \cos \relax (x)}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} - \frac {\log \left (\cos \relax (x) + 1\right )}{2 \, {\left (a + b\right )}} + \frac {\log \left (\cos \relax (x) - 1\right )}{2 \, {\left (a + b\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.67, size = 853, normalized size = 20.31 \[ \frac {\mathrm {atan}\left (\frac {\frac {\left (\frac {8\,a\,b^3+4\,b^4+4\,a^2\,b^2-\frac {\cos \relax (x)\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{2\,\left (a+b\right )}}{2\,\left (a+b\right )}+4\,b^3\,\cos \relax (x)\right )\,1{}\mathrm {i}}{2\,\left (a+b\right )}-\frac {\left (\frac {8\,a\,b^3+4\,b^4+4\,a^2\,b^2+\frac {\cos \relax (x)\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{2\,\left (a+b\right )}}{2\,\left (a+b\right )}-4\,b^3\,\cos \relax (x)\right )\,1{}\mathrm {i}}{2\,\left (a+b\right )}}{\frac {\frac {8\,a\,b^3+4\,b^4+4\,a^2\,b^2-\frac {\cos \relax (x)\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{2\,\left (a+b\right )}}{2\,\left (a+b\right )}+4\,b^3\,\cos \relax (x)}{2\,\left (a+b\right )}+\frac {\frac {8\,a\,b^3+4\,b^4+4\,a^2\,b^2+\frac {\cos \relax (x)\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{2\,\left (a+b\right )}}{2\,\left (a+b\right )}-4\,b^3\,\cos \relax (x)}{2\,\left (a+b\right )}}\right )\,1{}\mathrm {i}}{a+b}+\frac {\mathrm {atan}\left (\frac {\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\cos \relax (x)+\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3+2\,b^4+2\,a^2\,b^2-\frac {\cos \relax (x)\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{4\,\left (a^2+b\,a\right )}\right )}{2\,\left (a^2+b\,a\right )}\right )\,1{}\mathrm {i}}{a^2+b\,a}+\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\cos \relax (x)-\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3+2\,b^4+2\,a^2\,b^2+\frac {\cos \relax (x)\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{4\,\left (a^2+b\,a\right )}\right )}{2\,\left (a^2+b\,a\right )}\right )\,1{}\mathrm {i}}{a^2+b\,a}}{\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\cos \relax (x)+\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3+2\,b^4+2\,a^2\,b^2-\frac {\cos \relax (x)\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{4\,\left (a^2+b\,a\right )}\right )}{2\,\left (a^2+b\,a\right )}\right )}{a^2+b\,a}-\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\cos \relax (x)-\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3+2\,b^4+2\,a^2\,b^2+\frac {\cos \relax (x)\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{4\,\left (a^2+b\,a\right )}\right )}{2\,\left (a^2+b\,a\right )}\right )}{a^2+b\,a}}\right )\,\sqrt {-a\,b}\,1{}\mathrm {i}}{a\,\left (a+b\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\csc {\relax (x )}}{a + b \cos ^{2}{\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________